local lsp_fuai = fk.CreateSkill {
    name = "lsp_fuai",
}

Fk:loadTranslationTable {
    ["lsp_fuai"] = "复哀",
    [":lsp_fuai"] = "出牌阶段，你可以获得牌堆的顶牌和底牌，若两张牌类型不同，此技能失效，然后与一名其他角色失去X点体力(X为此技能的发动次数)。",

    ["@@lsp_fuai-phase"] = "复哀失效",
    ["@lsp_fuai"] = "复哀",
}

lsp_fuai:addEffect("active", {
    anim_type = "drawcard",
    prompt = "复哀：你可以获得牌堆顶和牌堆底的各一张牌",
    card_num = 0,
    target_num = 0,
    can_use = function(self, player)
        return player:getMark("@@lsp_fuai-phase") == 0
    end,
    card_filter = Util.FalseFunc,
    target_filter = Util.FalseFunc,
    on_use = function(self, room, effect)
        local player = effect.from
        local card1 = player:drawCards(1, lsp_fuai.name, "top")[1]
        local card2 = player:drawCards(1, lsp_fuai.name, "bottom")[1]
        room:addPlayerMark(player, "@lsp_fuai")
        if Fk:getCardById(card1).type ~= Fk:getCardById(card2).type then
            -- room:changeMaxHp(player, 1)
            room:setPlayerMark(player, "@@lsp_fuai-phase", 1)
            local to = room:askToChoosePlayers(player, {
                targets = room:getOtherPlayers(player),
                min_num = 1,
                max_num = 1,
                prompt = "复哀：选择一名角色，与其各失去" .. player:getMark("@lsp_fuai") + player:getMark("lsp_xuanyan") .. "点体力",
                skill_name = lsp_fuai.name,
                cancelable = false,
            })[1]
            room:loseHp(player, player:getMark("@lsp_fuai") + player:getMark("lsp_xuanyan"))
            room:loseHp(to, player:getMark("@lsp_fuai") + player:getMark("lsp_xuanyan"))
            room:setPlayerMark(player, "@lsp_fuai", 0)
        end
    end,
})

return lsp_fuai
